package lion.framework.core.task.rule;

import lion.dev.lang.MapJ;
import lion.framework.core.task.ITaskTimerRule;

/**
 * 
 * 
 * @author lion
 * @email hl_0074@sina.com
 * @date 2015年3月18日
 */
public abstract class AbstractTimerRule implements ITaskTimerRule {

	protected int timesLimited = -1;
	private boolean stopOnError = false;

	protected AbstractTimerRule(MapJ config) {

		timesLimited = config.getInt("times");
		stopOnError = config.getBoolean("stoponerror");
	}

	@Override
	public int getTimesLimited() {

		return timesLimited;
	}

	public void setTimesLimited(int timesLimited) {

		this.timesLimited = timesLimited;
	}

	@Override
	public boolean isStopOnError() {

		return stopOnError;
	}

	public void setStopOnError(boolean stopOnError) {

		this.stopOnError = stopOnError;
	}

}
